# -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 14:13:58 2021

@author: hp
"""

import numpy as np;
import pandas as pd;

input_data = "D:/PythonWord/3/Apriori/data/MyTest.xlsx";
output_data = "D:/PythonWord/3/Apriori/data/MyTest_1.xlsx";
data = pd.read_excel(input_data, header = None, index_col=0);
ct = lambda x : pd.Series(1, index = x[pd.notnull(x)])#转换0-1矩阵的过渡函数
b = map(ct, data.values);
data = pd.DataFrame(list(b)).fillna(0);
#data = data.drop([0]);
#data = data.drop(['购买清单'],axis = 1);
#data = data.drop(axis = 0);
del b;
#data.to_excel(output_data);
print(data);